package cn.starrysky108.simpleerp.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 订单状态枚举
 *
 * @author Carl Lee
 */
public enum OrderStatusEnum {
    /**
     * 1-->待审核
     */
    UNREVIEWED(1, "待审核"),
    /**
     * 2-->审核中
     */
    REVIEWING(2, "审核中"),
    /**
     * 3-->审核正常
     */
    REVIEWED(3, "审核正常"),
    /**
     * 4-->异常
     */
    ERROR(4, "异常"),
    /**
     * 5-->订单完成
     */
    FINISHED(5, "订单完成");

    /**
     * 枚举代码
     */
    @EnumValue
    private final int code;
    /**
     * 序列化返回值
     */
    @JsonValue
    private final String description;

    OrderStatusEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public String toString() {
        return "OrderStatusEnum{" +
                "code=" + code +
                ", description='" + description + '\'' +
                '}';
    }
}
